package Function.ItemUse;

import VWorldGameStudio.FCBattleOrder;
import VWorldGameStudio.FCMonster;
import VWorldGameStudio.FCPlayerInfo;
import VWorldGameStudio.FCTank;

import static FCRendering.FCRMaster.fcv;
import static FCRendering.FCRMaster.gameSave;

//世界地图
public class ToolWroldMap extends AItemUse{
    @Override
    public ItemUseResult directUse() {
        if(fcv.isBattle()){
            fcv.getMessage().add("不能在战斗中使用");
            fcv.showMessage();
            return new ItemUseResult().useless();
        }

        fcv.closeAllShowWindw();
        gameSave.setHasStartMapFunction(true);
        useAfter();
        fcv.getMessage().add("地图功能开启，按X即可");
        fcv.showMessage();
        return new ItemUseResult();
    }

    @Override
    public ItemUseResult useInMapTarget(int x, int y) {
        return directUse();
    }

    @Override
    public ItemUseResult useForMonsterTarget(FCBattleOrder battleOrder, FCMonster m) {
       return new ItemUseResult().useless();
    }

    @Override
    public ItemUseResult useForPlayerTarget(FCPlayerInfo p) {
        return directUse();
    }

    @Override
    public ItemUseResult useForTankTarget(FCTank t) {
        return   new ItemUseResult().useless();
    }
}
